<?php

/**
 * This is the model class for table "config_group".
 *
 * The followings are the available columns in table 'config_group':
 * @property string $id
 * @property string $name
 * @property string $description
 */
class ConfigGroup extends ConfigGroupPeer
{
	var $className = __CLASS__;
	
	/**
	 * Returns the static model of the specified AR class.
	 * @return ConfigGroup the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

    /**
     * get all brand and dump it into an array
     * @return Array Of ConfiGroup
     * Each item is an instance of brand object, include fields as follow:
     *  - id: id of brand
     *  - name: name of brand
     */
    public static function dumpAllGroupToArray($label = '', $disabled = '') {
        $array   = array();
        $criteria = new CDbCriteria();
        $criteria->select = "id, name";
        $criteria->order = "name, id";
        if($disabled) $criteria->condition = 'id <> '.$disabled;
        $items = ConfigGroup::model()->findAll($criteria);
        if($label) $array[''] = $label;
        foreach($items as $item)
        {
            $array[$item->id] = $item->name;
        }
        return $array;
    }
}